package com.css.fxfzdzzh.util;

import cn.hutool.core.convert.Convert;

import java.util.UUID;

/**
 * @author Dbj
 * @date 2022年08月02日  15:51
 */
public class StringUtils {

    public static String buildPrimaryId(){
        String s = UUID.randomUUID().toString();
        return s.replace("-","");
    }

    /**
     * 将2022转成二〇二二
     */
    public static String transLowNumToUpper(String numStr){
        StringBuilder builder = new StringBuilder();
        for (char c : numStr.toCharArray()) {
            int cv = c - '0';
            if(!String.valueOf(cv).equals("0")){
                String s = Convert.numberToChinese(cv, false);
                builder.append(s);
            }else{
                builder.append("〇");
            }
        }
        return builder.toString();
    }
}
